import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

//获取原型对象上的push函数
const originalPush = VueRouter.prototype.push
//修改原型对象中的push方法
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

const routes = [
  {
    path: '/faq1',
    name: 'faq1',
    component: () => import('@/views/FAQ1')
  },
  {
    path: '/faq2',
    name: 'faq2',
    component: () => import('@/views/FAQ2')
  },
  {
    path: '/faq3',
    name: 'faq3',
    component: () => import('@/views/FAQ3')
  },
  {
    path: '/faq4',
    name: 'faq4',
    component: () => import('@/views/FAQ4')
  },
  {
    path: '/success',
    name: 'success',
    component: () => import('@/views/success')
  },
  {
    path: '/search3',
    name: 'search3',
    component: () => import('@/views/search3')
  }
]

const router = new VueRouter({
  routes
})

export default router
